import { createRouter,createWebHashHistory } from 'vue-router'


//制定路由规则
const routes=[
    {
        path:'/',
        name:'main',
        component:()=>import("@/views/main.vue"),
        redirect:'/home',
        children:[
            // {
            //     path:'home',
            //     name:'home',
            //     component:()=>import("@/views/home.vue")
            // },
            // {
            //     path:'user',
            //     name:'user',
            //     component:()=>import("@/views/user.vue")
            // },
            // {
            //     path:'mall',
            //     name:'mall',
            //     component:()=>import("@/views/mall.vue")
            // },
       
        ],
    },
    {
        path:'/login',
        name:'login',
        component:()=>import("@/views/login.vue")
    },
    {
        path:'/404',
        name:'404',
        component:()=>import("@/views/404.vue")
    },
        
];

const router=createRouter({
    // history模式
    history:createWebHashHistory(),
    routes,
});

export default router;